package com.ysccc.shares.manager.impl;

import java.util.Date;

import org.springframework.stereotype.Component;
import org.springframework.transaction.annotation.Transactional;

import com.ysccc.shares.entity.SharesDaily;
import com.ysccc.shares.manager.SharesDailyManager;
import com.ysccc.spring.boot.starter.sqldb.manager.BaseManagerImpl;
import com.ysccc.spring.boot.starter.sqldb.repository.support.FilterParamBuilder;
import com.ysccc.tools.Dates;

@Component
@Transactional(readOnly = true)
public class SharesDailyManagerImpl extends BaseManagerImpl<SharesDaily> implements SharesDailyManager {

	@Override
	public SharesDaily getByDay(Date day, Long sharesId) {
		return super.findOne(FilterParamBuilder.create().eq("day", Dates.clearTime(day)).eq("shares.id", sharesId).build()).orElse(null);
	}

}
